<template>
  <el-form ref="form" v-bind="$attrs" :model="model" :rules="rules" label-position="left" label-width="labelWidth" :inline="inline" v-on="$listeners">
    <slot />
  </el-form>
</template>
<script>
export default {
  name: 'FormBlock',
  props: {
    model: {
      type: Object,
      default: null
    },
    rules: {
      type: Object,
      default: () => {
        return {}
      }
    },
    labelWidth: {
      type: String,
      default: '50px'
    },
    inline: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    validate(props) {
      this.$refs.form.validate(props)
    },
    validateField(props) {
      this.$refs.form.validateField(props)
    }
  }
}
</script>
